@model CaseSearchInput
<fieldset>
    <legend>@Mui.Search caz</legend>
    <div class="searchbox">
        <div class="ia">
            @Html.EditorFor(o => o.CourtId)
            @Html.EditorFor(o => o.TypeId)
            @Html.EditorFor(o => o.Number)
            @Html.EditorFor(o => o.ReferenceNumber)
            
           
        </div>
        <div class="ia">
            @Html.EditorFor(o => o.StatusId)
            @Html.EditorFor(o => o.PartyTypeId)
            @Html.EditorFor(o => o.LastName)
            @Html.EditorFor(o => o.FirstName)
        </div>
        <div class="ia" style="width:40em;">
            <div class="efield">
                <div class="elabel">
                    @Mui.Registration_date
                </div>
                <div class="einput smallinput">
                    @Html.DropDownList("RegistrationInterval", Icms.WebUI.Controllers.Globals.DateIntervals())
                    <div class="fr">@Html.TextBox("RegistrationTo", Model.RegistrationTo, new { @class = "dt" })</div>
                    <div class="fr">@Html.TextBox("RegistrationFrom", Model.RegistrationFrom, new { @class = "dt" })</div>                    
                </div>                
            </div>
            
        </div>
        <div class="efield">
            <div class="einput">
                <input type="submit" value="Cauta" />
                <a href="#" id="btnClear" class="abtn fl">Curata</a>
            </div>
        </div>
    </div>
</fieldset>
<br class="cbt" />
<script type="text/javascript">

    $(document).ready(function () {
        $("#RegistrationInterval").change(function () {
            var selected = $("#RegistrationInterval option:selected").val();
            setDatesFromInterval(selected, 'RegistrationFrom', 'RegistrationTo');
        });
     
        $("#btnClear").click(ClearForm);
    });

    function ClearForm() {
        $(".searchbox input[type='text']").val("");
        $(".searchbox select>option").removeAttr("selected");
        $(".searchbox select>option:first").attr("selected", "true");
    }
</script>
